<template>
  <div id="love_transfer">
    <c-title :hide="false" :text="isTransformActive ? `转化${love_name}` : `转化${balanceLang}`"></c-title>
    <!-- 优化 -->
    <diyBackGround></diyBackGround>
    <div class="nowPrice">
      <div class="priceIs">{{ isTransformActive ? `当前${balanceLang}` : `当前${love_name}` }}：{{ usable }}</div>
      <div class="main">
        <div class="balanceTxt">{{ isTransformActive ? `转化${love_name}` : `转化${balanceLang}` }}</div>
        <div class="contenBox">
          <div class="left">
            <div class="image">
              <img src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/images/balance/zuanshi@2x.png" alt="" />
            </div>
            <input type="number" v-model="sell_value" placeholder="0.00" />
          </div>
          <div class="contenTxt" @click="allConversion">全部兑换</div>
        </div>
<!--        <div class="tips" v-if="!isTransformActive">例如：100个{{ balanceLang }}可以转化{{ Math.floor(((100 * rate) / 100) * 100) / 100 }}个{{ love_name }}</div>-->
        <div class="btn" @click="saleBalance">确认转化</div>

        <div class="tips">
          注：转化比例为1:1，<br />
          您实际转账到数为：{{ Math.floor(((sell_value) / 100) * 100) }}
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import trading_controller from "./trading_controller";

export default trading_controller;
</script>
<style lang="scss" rel="stylesheet/scss" scoped>
#love_transfer {
  .nowPrice {
    text-align: left;
    margin: 0 0.625rem;
    margin-top: -5.5938rem;

    .priceIs {
      font-size: 0.875rem;
      font-weight: 400;
      color: #333;
      margin-bottom: 0.9375rem;
    }

    .main {
      background: #fff;
      box-shadow: 0 0.0625rem 0.25rem 0 rgba(7, 11, 33, 0.11);
      border-radius: 0.3125rem;
      padding: 1.25rem 1.25rem 1.0313rem 1.25rem;

      .btn {
        margin: 0 auto;
        width: 85%;
        height: 2.4375rem;
        background: #f25354;
        border-radius: 0.375rem;
        font-size: 0.9688rem;
        display: flex;
        justify-content: center;
        align-items: center;
        color: #fff;
        margin-top: 3.2188rem;
      }

      .tips {
        font-size: 0.7188rem;
        font-weight: 400;
        color: #888;
        margin-top: 0.75rem;
        text-align: left;
      }

      .contenBox {
        display: flex;
        margin-top: 1.8125rem;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 0.9688rem;
        border-bottom: 1px solid #ffe7e7e7;

        .left {
          display: flex;
          align-items: center;

          input {
            width: 100%;
            border: none;
            font-weight: 400;
            font-size: 1.5938rem;
          }

          .image {
            width: 1.4063rem;
            height: 1.2813rem;
            margin-right: 1.3438rem;

            img {
              width: 100%;
              height: 100%;
            }
          }
        }

        .contenTxt {
          font-size: 0.75rem;
          font-weight: 400;
          color: #f15353;
          white-space: nowrap;
        }
      }
    }
  }
}
</style>
